/*
 * FileProperties.java
 *
 * Copyright(c) 2010
 * Michael Kroez
 * kroez@studiorutton.de
 *
 * All rights reserved.
 *
 * $Id$
 * 
 */

package de.studiorutton.access;

import java.util.Date;


public class FileProperties {
	public long contentLength;
	public String contentType;
	public String contentEncoding;
	public Date lastModified;
	
	public FileProperties() {
		contentLength = 0;
		contentType = "";
		contentEncoding = "";
		lastModified = null;
	}

	public FileProperties(long contentLength, String contentType,
			String contentEncoding, Date lastModified) {
		this.contentLength = contentLength;
		this.contentType = contentType;
		this.contentEncoding = contentEncoding;
		this.lastModified = lastModified;
	}
	
	public boolean isNewerThan( FileProperties compareFp ) {
		if (lastModified == null )
			throw new IllegalArgumentException( "lastModified == null ");
		if (lastModified.after( compareFp.lastModified ))
			return true;
		else
			return false;
		
	}
}